package com.xianggu.designMode.decorator.demo01;

/**
 *抽象装饰角色
 * @author chengjy
 * @date 2025/3/14
 */
public abstract class Granish extends FastFood{ // 抽象装饰角色

    private FastFood fastFood;

    public Granish(FastFood fastFood, float price, String desc) {
        super(price, fastFood.getDesc() + "加" + desc);
        this.fastFood = fastFood;
    }

    public FastFood getFastFood() {
        return fastFood;
    }

    public void setFastFood(FastFood fastFood) {
        this.fastFood = fastFood;
    }

    @Override
    public float cost() {
        return fastFood.getPrice();
    }
}
